//唤醒指令
unsigned char Wakecmd[9] = {0x7E, 0x00, 0x08, 0x01, 0x00, 0x02, 0x01, 0xAB, 0xCD};

void Scaner_Init()
{
  Serial3.begin(9600);
}

String Scan_QR()
{
  unsigned long starttime;
  String str = "";
  Serial3.write(Wakecmd, 9);
  //等待回收信号结束
  while (Serial3.read() != 0x31);
  starttime = millis();
  while (true)
  {
    //扫码模块扫出来是会加换行符的
    str = Serial3.readStringUntil('/r');
    if ((str.length() >= 3) || (millis() - starttime > 5000))
      break;
  }
  return str;
}
